<template>
  <div class="p_footer">
    <div class="item itemL">
      <router-link tag="div" :to="{path:'/rolloff?type='+type}">转出</router-link>
    </div>
    <div class="item itemR">
      <div v-if="type=='PS'" @click="getUserData">转入</div>
      <!--  :to="{path:'/into?type='+type}" -->
      <router-link tag="div" :to="{path:'/exchange?type='+type}" v-else>兑换</router-link>
    </div>
  </div>
</template>
<script>
import { getGuid } from "../../../utils/index.js";
import { Indicator, Toast } from "mint-ui";
import { getUserInfo } from "../../../api";

export default {
  data() {
    return {
      isVip: false
    };
  },
  props: {
    type: ""
  },
  mounted() {
    this.getUser();
  },
  methods: {
    getUser() {
      let id = localStorage.zyUserId;
      getUserInfo({
        ID: id,
        LoginMachine: getGuid()
      }).then(res => {
        if (res.data && res.data.Success) {
          let { MemberOrder } = res.data.EntityList[0];
          this.isVip = MemberOrder == "5" ? true : false;
        } else {
          Toast({
            message: res.data.Content,
            duration: 3000
          });
          // this.$router.push("/login");
        }
      });
    },
    getUserData() {
      this.$router.push("/into");
    }
  }
};
</script>
<style lang="stylus" scoped>
.p_footer {
  width: 100%;
  height: 1.16rem;
  line-height: 1.16rem;
  display: flex;

  .item {
    flex: 1;
    text-align: center;
  }

  .itemL {
    background: #fff;
    color: #FF6F3A;
  }

  .itemR {
    background: #FF6F3A;
    color: #fff;
  }
}
</style>

